<template>
	<yd-layout id='faqQuestion' class=''>
		<div class="textarea">
        	<yd-textarea  v-model.trim='textareaVal' placeholder="请输入问题描述~" maxlength="100"></yd-textarea>
		</div>
		<div class="btn" @click="submit">提交</div>
	</yd-layout>
</template>

<script>
	import {TextArea} from 'vue-ydui/dist/lib.rem/textarea';
	export default{
		components:{
			[TextArea.name]:TextArea
		},
		data(){
			return {
				textareaVal:''
			}
		},
		created() {
		},
		watch: {
			
		},
		computed: {
			
		},
		mounted(){
			document.title='提问'
		},
		methods:{
			submit(){
				if(this.textareaVal){
					this.$root.ajax({
						name:'Qa/add', 
						params:{
							question:this.textareaVal,
						}
					}).then((d)=>{
						this.$router.push({
							name:'faqSuccess'
						})
					})	
				}else{
					this.$dialog.toast({
	                    mes: '请输入问题描述',
	                    timeout: 1500
	                });
				}
				
			}
		}
	}
</script>

<style lang="scss">
	@import './faqQuestion.scss';
</style>